namespace AutoBackupSql.Models
{
    public class BackupSettings
    {
        public DatabaseSettings SourceDatabase { get; set; } = new();
        public TargetServerSettings TargetServer { get; set; } = new();
        public ScheduleSettings BackupSchedule { get; set; } = new();
        public string LocalBackupPath { get; set; } = string.Empty;
        public string LogPath { get; set; } = string.Empty;
    }

    public class DatabaseSettings
    {
        public string Server { get; set; } = string.Empty;
        public int Port { get; set; } = 3306;
        public string Database { get; set; } = string.Empty;
        public string Username { get; set; } = string.Empty;
        public string Password { get; set; } = string.Empty;

        public string GetConnectionString()
        {
            return $"Server={Server};Port={Port};Database={Database};Uid={Username};Pwd={Password};";
        }
    }

    public class TargetServerSettings
    {
        public string Host { get; set; } = string.Empty;
        public int Port { get; set; } = 22;
        public string Username { get; set; } = string.Empty;
        public string Password { get; set; } = string.Empty;
        public string BackupPath { get; set; } = string.Empty;
    }

    public class ScheduleSettings
    {
        public string CronExpression { get; set; } = "0 2 * * *"; // 默认每天凌晨2点
        public int RetentionDays { get; set; } = 30;
        public int MaxRetries { get; set; } = 3;
        public int RetryIntervalMinutes { get; set; } = 5;
    }
} 